package com.sdry.service.llm;

import java.util.List;
import java.util.Map;

import com.sdry.model.llm.LlmCancellingStocksDetail;
import com.sdry.model.lz.Customer;
import com.sdry.model.lz.Materiel;
import com.sdry.model.zc.ZcInventoryInfoEntity;
import com.sdry.model.zc.ZcRejectsWarehouseEntity;

/**
 * 退库单详情
 * @Title:CancellingStockDetailService
 * @Package com.sdry.service.llm
 * @author llm
 * @date 2019年5月15日
 * @version 1.0
 */
public interface CancellingStockDetailService {

	/**
	 * 获取退库单详情总行数
	 * @Title:getCountCancellingStockDetail   
	 * @param csid 退库单ID
	 * @return
	 */
	Integer getCountCancellingStockDetail(LlmCancellingStocksDetail cancellingStockDetail);
	
	/**
	 * 分页查询退库单详情
	 * @Title:listPageCancellingStockDetail   
	 * @param map 参数集合
	 * @return
	 */
	List<LlmCancellingStocksDetail> listPageCancellingStockDetail(Map<String, Object> map);
	
	/**
	 * 新增退库单详情
	 * @Title:saveCancellingStockDetail   
	 * @param cancellingNumber 退库单号
	 * @param ids 物料ID拼接字符串
	 * @param source 
	 * @param warehouseId 
	 * @return
	 */
	Integer saveCancellingStockDetail(String ids, String cancellingNumber, String source, String warehouseId, String customerId);
	
	/**
	 * 修改退库单详情
	 * @Title:updateCancellingStockDetail   
	 * @param cancellingStockDetail 退库单详情实体类
	 * @return
	 */
	Integer updateCancellingStockDetail(LlmCancellingStocksDetail cancellingStockDetail);
	
	/**
	 * 删除退库单详情
	 * @Title:deleteCancellingStockDetail
	 * @param ids 退库单详情ID
	 * @return
	 */
	Integer deleteCancellingStockDetail(String ids);

	/**   
	 * 根据退库单号查询详情
	 * @Title:getCancellingStockDetailById   
	 * @param cancellingNumber 退库单号
	 * @return             
	 */
	List<LlmCancellingStocksDetail> getCancellingStockDetailByNumber(String cancellingNumber);
	
	/**   
	 * 根据退库单详情ID查询退库单详情
	 * @Title:getCancellingStockDetailByDetailId   
	 * @param id
	 * @return             
	 */
	LlmCancellingStocksDetail getCancellingStockDetailByDetailId(Long id);

	/**  
	 * 根据物料ID获取库存数量 
	 * @Title:getQuantityByMid   
	 * @param id
	 * @return             
	 */
	//ZcInventoryInfoEntity getQuantityByMid(Long id);
	List<ZcInventoryInfoEntity> getQuantityByMid(Map<String, Object> map);

	/**   
	 * 获取物料总数
	 * @Title:getCountMaterielByCustomerIdAndWarehouseId   
	 * @param map
	 * @return             
	 */
	int getCountMaterielByCustomerIdAndWarehouseId(Map<String, Object> map);

	/**   
	 * 分页查询物料
	 * @Title:listPageMaterielByCustomerIdAndWarehouseId   
	 * @param map
	 * @return             
	 */
	List<Materiel> listPageMaterielByCustomerIdAndWarehouseId(Map<String, Object> map);

	/**   
	 * 修改退库物料数量
	 * @Title:updateCancellingStockDetail2   
	 * @param map
	 * @return             
	 */
	int updateCancellingStockDetail2(Map<String, Object> map);

	/**   
	 * 修改库存数量
	 * @Title:updateInventory   
	 * @param map             
	 */
	Integer updateInventory(Map<String, Object> map);

	/**   
	 * 根据仓库ID分页查询物料
	 * @Title:getCountMaterielByWarehouseId   
	 * @param map
	 * @return             
	 */
	int getCountMaterielByWarehouseId(Map<String, Object> map);

	/**   
	 * 根据仓库ID分页查询物料
	 * @Title:listPageMaterielByWarehouseId   
	 * @param map
	 * @return             
	 */
	List<Materiel> listPageMaterielByWarehouseId(Map<String, Object> map);

	/**   
	 * 修改拆箱总数
	 * @Title:updateUnpacking   
	 * @param map             
	 */
	Integer updateUnpacking(Map<String, Object> map);
	
	/**   
	 * 查询不良品数量
	 * @Title:getBadQuantityByMid   
	 * @param map
	 * @return             
	 */
	ZcRejectsWarehouseEntity getBadQuantityByMid(Map<String, Object> map);

	/**   
	 * 查询良品数量
	 * @Title:getGoodQuantityByMid   
	 * @param map
	 * @return             
	 */
	ZcInventoryInfoEntity getGoodQuantityByMid(Map<String, Object> map);

	/**   
	 * 删除不良品库存数据
	 * @Title:deleteRejectsWarehouse   
	 * @param id             
	 */
	Integer deleteRejectsWarehouse(Long id);

	/**   
	 * 修改不良品库存数据
	 * @Title:updateRejectsWarehouse   
	 * @param map             
	 */
	Integer updateRejectsWarehouse(Map<String, Object> map);

	/**
	 * 根据物料ID查库存
	 * @param materialId
	 * @return
	 */
	List<ZcInventoryInfoEntity> getInventoryByMid(Long materialId);

	/**
	 * 刪除庫存
	 * @param id
	 */
	Integer deleteInventoryById(Long id);

	/**
	 * 查不良品
	 * @param materielId
	 * @return
	 */
	List<ZcRejectsWarehouseEntity> queryRejectsByMaterielId(Long materielId);
	
	/**   
	 * 根据id查供应商
	 * @Title:getCustomerById   
	 * @param id
	 * @return             
	 */
	Customer getCustomerById(Long id);
}
